package main

import (
	"fmt"
	db2 "golang-learning/gorm/db"
	"golang-learning/gorm/model"
	"log"
)

func main() {
	/*获得连接*/
	db, err := db2.GetMysqlDbConn()

	if err != nil {
		fmt.Println(err)
		return
	}

	var baseChnlCountByStList []model.BaseChnlCountBySt
	db.Debug().Raw("select chnl_st,count(1) as count from base_chnl where rec_crt_oprid=? group by chnl_st ", "1").Scan(&baseChnlCountByStList)
	log.Println(baseChnlCountByStList)
	log.Println(baseChnlCountByStList[0].ChnlSt)

}
